package com.kang.controller;

import com.kang.bean.Process;
import com.kang.commons.Result;
import com.kang.service.ProcessService;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: service
 * @description: 流程控制类
 * @author: K.faWu
 * @create: 2022-04-11 15:14
 **/
@RestController
@RequestMapping("process")
public class ProcessController {

    private final ProcessService processService;

    public ProcessController(ProcessService processService) {
        this.processService = processService;
    }

    /**
     * 发起流程
     */
    @PutMapping
    public Result<?> launch(@RequestBody Process process){
        processService.launch(process);
        return Result.success();
    }
}
